#!/bin/bash
cd /etc/netplan/
gzip 01-netcfg.yaml
read -p "please ip address: " IP
cat 50-cloud-init.yaml.bak | sed '/\/24$/c "            - '"$IP"'/24' | sed 's/"//' > 50-cloud-init.yaml
chmod 644 50-cloud-init.yaml
netplan apply
cd
